﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Drawing;

namespace Alex_s_Dream_The_Toy_World
{
    public class Node 
    { 
        public Point Position; 
        public Node Parent;
        private Node nextNode;

        public Node NextNode
        {
            get { return nextNode; }
            set { nextNode = value; }
        }
 
        public int F; 
        public int G; 
        public int H; 
 
        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="position">Position of the node</param>
        /// <param name="parent">Parent of the node</param>
        /// <param name="g">The movement cost to move from the starting point to this position</param>
        /// <param name="h">The estimated movement cost to move from this point to the final destination</param>
        public Node(Point position, Node parent, int g, int h) 
        { 
            Position = position; 
            Parent = parent;
            G = g; 
            H = h; 
            F = g + h;
            NextNode = null;
        }

        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="position">Position of the node</param>
        public Node(Point position)
        {
            Position = position;
            Parent = null;
            G = 0;
            H = 0;
            F = 0;
            NextNode = null;
        }
    } 
}
